package com.mimi.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.joda.time.LocalTime;

import com.mimi.core.AbstractBaseIdObject;

@Entity
@Table(name = "tbl_company")
public class Company extends AbstractBaseIdObject {
	private static final long serialVersionUID = -8384380778036230711L;
	private String companyName;
	private String address;
	private String phone;
	private String fax;
	private String homepage;
	private String email;
	private String shopName;
	private String shopAddress;
	private String shopPhone;
	private LocalTime startTime;
	private LocalTime endTime;

	@Column(name = "company_name", length = 40)
	@NotBlank
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		final String old = this.companyName;
		this.companyName = companyName;
		firePropertyChange("companyName", old, this.companyName);
	}

	@Column(name = "address", length = 256)
	@NotBlank
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		final String old = this.companyName;
		this.address = address;
		firePropertyChange("address", old, this.address);
	}

	@Column(name = "phone", length = 15)
	@NotBlank
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		final String old = this.phone;
		this.phone = phone;
		firePropertyChange("phone", old, this.phone);
	}

	@Column(name = "fax", length = 15)
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		final String old = this.fax;
		this.fax = fax;
		firePropertyChange("fax", old, this.fax);
	}

	@Column(name = "home_page", length = 256)
	public String getHomepage() {
		return homepage;
	}

	public void setHomepage(String homepage) {
		final String old = this.homepage;
		this.homepage = homepage;
		firePropertyChange("homepage", old, this.homepage);
	}

	@Column(name = "email", length = 256)
	@Email
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		final String old = this.email;
		this.email = email;
		firePropertyChange("email", old, this.email);
	}

	@Column(name = "shop_name", length = 40)
	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		final String old = this.shopName;
		this.shopName = shopName;
		firePropertyChange("shopName", old, this.shopName);
	}

	@Column(name = "shop_address", length = 256)
	public String getShopAddress() {
		return shopAddress;
	}

	public void setShopAddress(String shopAddress) {
		final String old = this.shopAddress;
		this.shopAddress = shopAddress;
		firePropertyChange("shopAddress", old, this.shopAddress);
	}

	@Column(name = "phone_phone", length = 15)
	public String getShopPhone() {
		return shopPhone;
	}

	public void setShopPhone(String shopPhone) {
		final String old = this.shopPhone;
		this.shopPhone = shopPhone;
		firePropertyChange("shopPhone", old, this.shopPhone);
	}

	@Column(name = "start_time")
	public LocalTime getStartTime() {
		return startTime;
	}

	public void setStartTime(LocalTime startTime) {
		this.startTime = startTime;
	}

	@Column(name = "end_time")
	public LocalTime getEndTime() {
		return endTime;
	}

	public void setEndTime(LocalTime endTime) {
		this.endTime = endTime;
	}
}
